//
// Created by wangwanlong on 2024/11/5.
//

#ifndef MKAHYPAR_HOP_PENALTY_POLICY_H
#define MKAHYPAR_HOP_PENALTY_POLICY_H

#include "mkahypar/utils/typedef.h"
#include "mkahypar/utils/policy_registry.h"
#include "mkahypar/utils/math.h"
#include "mkahypar/partition/context.h"

//路由惩罚策略
namespace mkahypar {

  class NormalHopPenaltyPolicy : public meta::PolicyBase {
  public:
    MKAHYPAR_ATTRIBUTE_ALWAYS_INLINE static inline GainType compute(GainType edge_weight, GainType distance) {
      GainType factor = distance > Context::getInstance().hop_limit ?
                        (distance - Context::getInstance().hop_limit) * 100 : 1;
      GainType gain = edge_weight * distance * distance;
//      GainType gain = edge_weight * distance * math::pow(static_cast<GainType>(2),factor);
      return gain;
    }


  };

}
#endif //MKAHYPAR_HOP_PENALTY_POLICY_H
